//  -------------------- iSharePoint -------------------- //
// 
//  Company:	IT Complex, LLC
//  Project:	Smart.Documents
//  File name:	IPdfWatermarker.cs
//  Developer:	Solomatov Igor
//  Created:	16.04.2012
// 
//  -------------------- iSharePoint -------------------- //

using Microsoft.SharePoint;
using iTextSharp.text;
using iTextSharp.text.pdf;

namespace Smart.Documents.Services
{
	public interface IPdfWatermarker
	{
		/// <summary>
		/// Add text as the watermark to each page of the source pdf to create a new pdf with text watermark
		/// </summary>
		/// <param name="site"> site to open from and save files to </param>
		/// <param name="sourceFileUrl"> the full path to the source pdf file </param>
		/// <param name="outputFileUrl"> the full path where the watermarked pdf file will be saved to </param>
		/// <param name="watermarkText"> the string array conntaining the text to use as the watermark. Each element is treated as a line in the watermark </param>
		/// <param name="watermarkFont"> the font to use for the watermark. The default font is HELVETICA </param>
		/// <param name="watermarkFontSize"> the size of the font. The default size is 48 </param>
		/// <param name="watermarkFontColor"> the color of the watermark. The default color is blue </param>
		/// <param name="watermarkFontOpacity"> the opacity of the watermark. The default opacity is 0.3 </param>
		/// <param name="watermarkRotation"> the rotation in degree of the watermark. The default rotation is 45 degree </param>
		bool AddWatermarkText(SPSite site, string sourceFileUrl, string outputFileUrl, string[] watermarkText, BaseFont watermarkFont, float watermarkFontSize,
		                      BaseColor watermarkFontColor, float watermarkFontOpacity, float watermarkRotation);

		/// <summary>
		/// Add text as the watermark to each page of the source pdf to create a new pdf with text watermark
		/// </summary>
		/// <param name="site"> site to open from and save files to </param>
		/// <param name="sourceFile"> the full path to the source pdf file </param>
		/// <param name="outputFileUrl"> the full path where the watermarked pdf file will be saved to </param>
		/// <param name="watermarkText"> the string array conntaining the text to use as the watermark. Each element is treated as a line in the watermark </param>
		/// <param name="watermarkFont"> the font to use for the watermark. The default font is HELVETICA </param>
		/// <param name="watermarkFontSize"> the size of the font. The default size is 48 </param>
		/// <param name="watermarkFontColor"> the color of the watermark. The default color is blue </param>
		/// <param name="watermarkFontOpacity"> the opacity of the watermark. The default opacity is 0.3 </param>
		/// <param name="watermarkRotation"> the rotation in degree of the watermark. The default rotation is 45 degree </param>
		bool AddWatermarkText(SPSite site, SPFile sourceFile, string outputFileUrl, string[] watermarkText, BaseFont watermarkFont, float watermarkFontSize, BaseColor watermarkFontColor,
		                      float watermarkFontOpacity, float watermarkRotation);

		/// <summary>
		/// Load font from Windows
		/// </summary>
		/// <param name="fontFileName">Font file name</param>
		/// <param name="encoding"> Cp1251 </param>
		/// <param name="embedded">BaseFont.EMBEDDED or BaseFont.NOT_EMBEDDED</param>
		/// <returns></returns>
		BaseFont LoadFont(string fontFileName, string encoding, bool embedded);
	}
}